﻿// Closer reacts to browser events to show or hide its children component
define([
    'Xjs/core/util',
    'Xjs/ui/Control'
],
function (util, Control) {
    'use strict';

    var type = 'closer',
    Closer = Xjs.getType(type);

    if (Closer) { // It has been already loaded
        return Closer;
    }

    Closer = util.define({
        base: Control,
        construct: function (conf, parent) {
            Closer.base.constructor.call(this, conf, parent);

            this.target = conf.target; // The target to hide when closing
        },
        type: type,
        tag: 'div',
        
        close: function () {
            var target;

            if (this.target) {
                if (util.isString(this.target)) {
                }
            }
        }
    });

    Xjs.registerType(Closer);

    return Closer;
});